﻿using System;
using System.Collections.Generic;
using System.Text;
using Sinacor.Infra.Service.Security;
using Sinacor.Infra.Service.ExceptionHandling;
using System.ServiceModel;
using Sinacor.Service.Infra.AuthorizationService.Service.DataContract.Response;
using Sinacor.Infra.Service.Security.Services;

namespace Sinacor.Service.Infra.AuthorizationService.Service.ServiceContract
{
	[ExceptionShielding]
    [ServiceContract(Namespace = "http://www.bovespa.com.br/Sinacor.Service.Infra.AuthorizationService.Service.ServiceContract", Name = "IMenu", SessionMode = SessionMode.Allowed)]
	public interface IMenu
	{
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        [OperationLog]
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "RetrieveCompanies")]
		List<CompanyResponse> RetrieveCompanies();

		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))]
		[OperationLog]
		[OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "RetrieveModules")]
		List<ModuleResponse> RetrieveModules(int companyId);

		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))]
		[OperationLog]
		[OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "CheckRolePermission")]
		bool CheckRolePermission(string role, string moduleId, int companyId);
	}
}